package com.example.demo.danyuantest;

/**
 * @Description MethondTest1
 * @Author songchuanlong
 * @Date 2025-06-06
 */

import org.junit.Assert;
import org.junit.Test;

/**
 * 单元测试
 */
public class MethondTest1 {
    @Test
    public void testMethond(){
        Methonds.printNmuber("你好");
        Methonds.printNmuber(null);
    }

    @Test
    public void testMethond2(){
        System.out.println(Methonds.getMaxIndex("你好哈哈哈"));
        System.out.println(Methonds.getMaxIndex(null));
        //断言机制：可以拿预测结果和实际结果相比较
        Assert.assertEquals("结果不符合",4,Methonds.getMaxIndex("你好哈哈哈"));
        Assert.assertEquals("结果不符合",-1,Methonds.getMaxIndex(null));
    }


}
